<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户管理页面</title>
    <link th:href="@{/css/admin/userManage.css}" rel="stylesheet"/>
</head>
<body>
<th:block th:insert="~{admin/header :: sidebar}"/>
<h1>用户管理</h1>

<div class="navigation-bar">
    <div class="nav-title">用户管理</div>
    <form class="action-bar" action="#" method="get">
        <a href="/admin/addUser" class="btn btn-success action-bar-item" >创建新用户</a>
        <button class="btn btn-primary action-bar-item" type="submit">立即查询</button>
        <input class="form-control action-bar-item search-input" name="nickname" type="text"
               placeholder="请输入用户昵称">
        <input class="form-control action-bar-item search-input" name="number" type="text" placeholder="请输入用户电话">
    </form>
</div>

<!-- 用户列表表格 -->
<table>
    <thead>
    <tr>
        <th>用户名</th>
        <th>联系方式</th>
        <th>邮箱</th>
        <th>状态</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="user : ${userSearchResult.list}">
        <td th:text="${user.username}"></td>
        <td th:text="${user.phonenumber}"></td>
        <td th:text="${user.email}"></td>
        <td th:text="${user.userstatus == 0? '活跃' : '不活跃'}"></td>
        <td>
            <a href="admin/deleteUser" th:href="@{'deleteUser?id=' + ${user.getUserid()}}">删除用户</a>
            <a href="admin/editUser" th:href="@{'editUser?id=' + ${user.getUserid()}}">修改信息</a>
        </td>
    </tr>
    </tbody>
</table>
<div th:replace="admin/common/console-common :: common_pager(${userSearchResult})"></div>
</body>

</html>